package com.cqhilink.iot.jobstandardmanagement.facade.service.file;

import com.cqhilink.iot.jobstandardmanagement.facade.model.File;

import java.util.List;

/**
 * Created by yangcs on 2016/8/8.
 * 附件信息
 */
public interface JsmFileService {

    //插入文件
    int insertFile(String businessId, String[] filenames, String[] hbasepaths);

    // 复制关联的数据项
    int cloneInsert(String oldBusinessId, String newBusinessId);

    //根据业务id删除文件
    int delFileByBusinessId(String businessId);

    //根据业务id查询文件
    List<File> queryFilesByBusinessId(String businessId);

    //根据附件id获取附件信息
    File selectByPrimaryKey(String fileId);

    /**
     * 根据业务Id查询附件信息
     *
     * @param businessId
     * @return
     * @throws Exception
     */
    List<File> queryByBusinessId(String businessId) throws Exception;

    /**
     * 新增附件信息
     *
     * @param uploadFiles
     * @param deletedFiles
     * @param businessId
     * @return
     * @throws Exception
     */
    int addFile(String uploadFiles, String deletedFiles, String businessId) throws Exception;

    /**
     * 新增附件，并且删除其他无用附件信息
     *
     * @param uploadFiles
     * @param businessId
     * @return int
     * @throws Exception
     * @Author 卢曼成
     */
    int addDelFile(String uploadFiles, String businessId) throws Exception;

    /**
     * 修改附件信息
     *
     * @param uploadFiles
     * @param deletedFiles
     * @param businessId
     * @return
     * @throws Exception
     */
    int updateFile(String uploadFiles, String deletedFiles, String businessId) throws Exception;

    /**
     * 批量删除附件信息
     *
     * @param businessId
     * @return
     */
    int delByBusinessId(String businessId);

    /**
     * 根据businessId集合删除
     *
     * @param list
     * @return
     */
    int deleteListString(List<String> list);


    /**
     * 批量插入
     *
     * @param list
     * @return
     */
    int insertList(List<File> list);

}
